package springboot.doMain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.text.DecimalFormat;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class EngineerData {
  private String name;
  private int talkCnt;
  private int resCntW;
  private int resCnt;
  private int proCnt;
  private float resAvgW;
  private float resAvg;
  private float proAvg;
  /*未解决问题*/
  private int needPro;
  /*周期内新增问题*/
  private  int newPro;
  /*由他人记录问题的数量*/
  private int proOtherCnt;
  /* 期间总问题*/
  private int proAll;
  /*超时消息*/
  private int overTimeMsg;

  //format 返回的是字符串
  //构造方法的字符格式这里如果小数不足2位,会以0补足.
  public static DecimalFormat decimalFormat = new DecimalFormat("0.00");

  public void setResAvgW(float resAvgW) {
    this.resAvgW = Float.parseFloat(decimalFormat.format(resAvgW));
  }

  public void setResAvg(float resAvg) {
    this.resAvg = Float.parseFloat(decimalFormat.format(resAvg));
  }

  public void setProAvg(float proAvg) {
    this.proAvg = Float.parseFloat(decimalFormat.format(proAvg));
  }


  public EngineerData(String name) {
    this.name = name;
    this.talkCnt = 0;
    this.resCntW = 0;
    this.resCnt = 0;
    this.proCnt = 0;
    this.resAvgW = 0;
    this.resAvg = 0;
    this.proAvg = 0;
    this.proOtherCnt = 0;
    this.overTimeMsg = 0;
  }


}
